<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.org/ui" template="../../index.xhtml"
                xmlns:c="http://java.sun.com/jsp/jstl/core"
                xmlns:f="http://xmlns.jcp.org/jsf/core">


    <ui:define name="content">
        <!--Desenvolver listagem dos cestos de açai-->
        <h:form id="listagemCat">

            <p:growl id="grow"
                     showDetail="true"
                     sticky="false"/>

            <div align="center">
                <h:panelGrid width="900" style="border: none">
                    <p:panel header="Cestos Distribuidor">
                        <p:dataTable
                            value="#{cestoDistribuidorBean.cestos}"
                            var="cestos"
                            rows="5" paginator="true" id="cest"
                            paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                            rowsPerPageTemplate="6,12,16">

                            <p:column headerText="Código">
                                <div align="center">
                                    <h:outputText value="#{cestos.id}"/>
                                </div>
                            </p:column>

                            <p:column headerText="Tipo Cesto">
                                <h:outputText value="#{cestos.tipo}"/>
                            </p:column>

                            <p:column headerText="Capacidade(kg)">
                                <div align="center">
                                    <h:outputText value="#{cestos.capacidade}"/>
                                </div>
                            </p:column>

                            <p:column headerText="Operações">
                                <div align="center">
                                    <p:commandButton
                                        ajax="false"
                                        icon="ui-icon-pencil"
                                        action="#{cestoDistribuidorBean.editar()}">
                                        <f:setPropertyActionListener
                                            target="#{cestoDistribuidorBean.cesto}"
                                            value="#{cestos}"/>
                                    </p:commandButton>

                                    <p:commandButton
                                        ajax="false"
                                        icon="ui-icon-trash"
                                        action="#{cestoDistribuidorBean.excluir()}">
                                        <f:setPropertyActionListener
                                            target="#{cestoDistribuidorBean.cesto}"
                                            value="#{cestos}"/>
                                    </p:commandButton>
                                </div>
                            </p:column>
                        </p:dataTable>

                    </p:panel>
                </h:panelGrid>
            </div>
        </h:form>
    </ui:define>
</ui:composition>
